document<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>javascript 阶段</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background-color: #00f;
        }
        .container {
            width: 200px;
            background-color: #ccc;
        }
        img {
            display: block;
            width: 200px;
            margin: 0 0 10px 0;
        }
    </style>
</head>
<body>

    <div class="container"></div>


    <script>
        // 创建div标签
        var divCreate = document.createElement("div");
        // 设置类名
        divCreate.className = "box";

        // 往body标签添加元素
        document.body.appendChild(divCreate);



        // 创建img标签
        var imgCreate = document.createElement("img");
        imgCreate.src = "https://www.baidu.com/img/PC_69793e3487cd39e10b69d7358be8ca54.gif";

        var imgCreate2 = document.createElement("img");
        imgCreate2.src = "https://dlweb.sogoucdn.com/pcsearch/web/index/images/logo_440x140_31de1d2.png?v=d6bfe569";

        // 往container标签添加元素(追加元素) [img1,img2,img3]
        var container = document.querySelector(".container");
        container.appendChild(imgCreate);
        container.appendChild(imgCreate2);


        
        
    </script>
</body>
</html>